#/usr/bin/Rscript

on_100_20 <- read.table("on/profits.dat")
op_100_20 <- read.table("rf/profits.dat")
ut_100_20 <- read.table("ut/profits.dat")
print("100 op")
shapiro.test((op_100_20$V1 - on_100_20$V1) / abs(on_100_20$V1))
print("100 ut")
shapiro.test((ut_100_20$V1- on_100_20$V1) / abs(on_100_20$V1))

#QQplots

jpeg("normalidade_g_100.jpg")
par(mfrow=c(1, 2))

qqnorm((op_100_20$V1 - on_100_20$V1) / abs(on_100_20$V1), main="op 100 10")
qqline((op_100_20$V1 - on_100_20$V1) / abs(on_100_20$V1))
qqnorm((ut_100_20$V1 - on_100_20$V1) / abs(on_100_20$V1), main="ut 100 10")
qqline((ut_100_20$V1 - on_100_20$V1) / abs(on_100_20$V1))

jpeg("homocedasticidade_g_100.jpg")
par(mfrow=c(1, 2))

plot((op_100_20$V1- on_100_20$V1) / abs(on_100_20$V1), main="op 100 10")
plot((ut_100_20$V1- on_100_20$V1) / abs(on_100_20$V1), main="ut 100 10")

dev.off()



